<?php

/**
 * This is the model class for table "worker_recommend".
 *
 * The followings are the available columns in table 'worker_recommend':
 * @property integer $id ID
 * @property integer $worker_id 代理商id
 * @property integer $sort 排序位置
 * @property string $desc 推荐理由
 * @property integer $category_id Category
 */
class WorkerRecommend extends ActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return WorkerRecommend the static model class
	 */
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	
	public function getMdcClass() {
		return 'application.models.metadata.WorkerRecommendMetadata';
	}
	
	protected function beforeSave() {
		$this->category_id = CHtml::value($this, 'worker.info.category_id');
		return parent::beforeSave();
	}
}